package com.echo.util;

import net.iharder.Base64;

import java.io.IOException;

/**
 * Created by EchoGe on 2016/6/2.
 */
public class Base64Util {
    public static void main(String[] args){
        String str="123456";
        String encode=Base64.encodeBytes(str.getBytes());
        String decode="";
        try {
            decode=new String(Base64.decode(encode));
        } catch (IOException e) {
            e.printStackTrace();
        }
        System.out.println(encode);
        System.out.println(decode);

        System.out.println(PasswordUtil.getBase64(str));
        decode=PasswordUtil.getBase64(str);
        System.out.println(PasswordUtil.getFromBase64(decode));
    }
}
